home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / proc / fallocat.c < prev    next >
C/C++ Source or Header  |  1996-07-10  |  2KB  |  93 lines

  1. /*
  2.  * CopyRight 1995. Nicholas Poljakov all rights reserved.
  3.  */
  4. #include <malloc.h>
  5. #include <stdio.h>
  6. #include <alloc.h>
  7. #include <dos.h>
  8. #include <state1.h>
  9.  
  10.  allocate (lu_name,mode_name,tpn,return_control,security,
  11.            sync_level,user_id,password,tp_id,p_convid,
  12.            p_pip,p_rc)
  13.  
  14.  unsigned char lu_name[8];
  15.  unsigned char mode_name[8];
  16.  unsigned char tpn[64];
  17.  unsigned char return_control;
  18.  unsigned char security;
  19.  unsigned char sync_level;
  20.  unsigned char user_id[11];
  21.  unsigned char password[10];
  22.  unsigned char tp_id[8];
  23.  unsigned long *p_convid;
  24.  char *p_pip;
  25.  struct rc {
  26.   unsigned int prim;
  27.   unsigned long sec; } *p_rc;
  28.  
  29.  {
  30.   union REGS inregs,outregs;
  31.   struct SREGS segregs;
  32.   struct allocate *ptr;
  33.        char _near *dp1;
  34.        char _near *dp2;
  35.   int l;
  36.  
  37. toup(lu_name);
  38. toup(mode_name);
  39.  
  40.      l = sizeof(struct allocate);
  41.      if ((ptr = (char *)calloc(1,l)) == NULL)
  42.        {
  43.         p_rc->prim = PORT_BUSY; /* ¡ÑΓ ñ«ßΓπ»¡«⌐ »á¼∩Γ¿ */
  44.         p_rc->sec = 0x00;
  45.         return(0);
  46.         }
  47.  
  48.  
  49.      ptr->code=Allocate;
  50.      ptr->e_cd=0x0000;
  51.  
  52.      copy(ptr->p_lu_name,lu_name,8);
  53.  
  54.      copy(ptr->mode_name,mode_name,8);
  55.  
  56.      memcpy(ptr->tp_id,tp_id,8);
  57.      ptr->security = security;
  58.      ptr->sync_level = sync_level;
  59.      ptr->return_control = return_control;
  60.      strcpy(ptr->tp_name,tpn);
  61.      memcpy(ptr->password,password,10);
  62.      memcpy(ptr->user_id,user_id,11);
  63.      ptr->tp_lt = strlen(tpn);
  64.      ptr->pip = p_pip;
  65. /*
  66.      inregs.x.dx = FP_OFF(ptr);
  67.      segregs.ds = FP_SEG(ptr);
  68.      inregs.x.ax = ptr->code;
  69.  
  70.          int86x(0x68,&inregs,&outregs,&segregs);
  71.  */
  72.      dp1 = FP_OFF( ptr );
  73.      dp2 = FP_SEG( ptr );
  74.      _asm
  75.          {
  76.             push  ds
  77.             mov   dx, word ptr dp1[0]
  78.             mov   ax, word ptr dp2[0]
  79.             mov   ds, ax
  80.             mov   ax, Allocate
  81.             int   68h
  82.             pop   ds
  83.          }
  84.  
  85.   p_rc->prim = ptr->prim_rc;
  86.   p_rc->sec = ptr->sec_rc;
  87.   *p_convid = ptr -> conv_id;
  88.    free(ptr);
  89.  
  90.   return(0);
  91.  
  92.  }
  93.